﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Harvest.Api.Interfaces;
using System.Net;
using Hammock;
using System.Xml;
using Hammock.Serialization;

namespace Harvest.Api.Tests
{

    public class MockRestRequestProvider : IRestRequestProvider
    {

        private RestRequest _restRequest;

        public string Login { get; set; }

        public string Password { get; set; }

        public string Account { get; set; }


        public RestRequest RestRequest
        {
            get
            {
                return _restRequest;
            }
        }

        public MockRestRequestProvider(object expectedEntity, HttpStatusCode expectedStatusCode)
        {
            var serializer = new HammockXmlSerializer(new XmlWriterSettings());
            _restRequest = new RestRequest
            {
                Serializer = serializer,
                Deserializer = serializer
            };
            _restRequest.ExpectHeader("Custom-Header", "true");
            _restRequest.ExpectStatusCode = expectedStatusCode;
            _restRequest.ExpectEntity = expectedEntity;

            Account = "account";
            Login = "login";
            Password = "password";
        }


    }

}
